$(function() {
	var inObj = {
		trx_id : "XPINQSHT",
		action_flg : "F",
		fab_sn : "058-001-004"
	};
	
	$("#inObjTxt").val(JSON.stringify(inObj));
	
	var outObj = comTrxSubSendPostJson(inObj);
	console.info(outObj);

	function comTrxSubSendPostJson(inTrxObj, showErrDlg) {
		var qurl = contextPath + "/sendMsg.do";
		var inTrxStr = JSON.stringify(inTrxObj);
		var outTrxObj = null;

		jQuery.ajax({
			type : "post",
			url : qurl,
			timeout : 60000,
			data : {
				strInMsg : inTrxStr
			},
			async : false,
			beforeSend : function() {
			},
			complete : function() {// ajaxStop改为ajaxComplete也是一样的
			},
			success : function(data) {
				console.info(data);
				$("#outObjTxt").val(data);
				if (data instanceof Object) {
					outTrxObj = JSON.parse(data);
					var rtn_code = outTrxObj.rtn_code;
					if (rtn_code != "0000000") {
						if (showErrDlg && showErrDlg == "N") {
							;
						} else {
							showErrorDialog(rtn_code, outTrxObj.rtn_mesg);
						}
					}
				}
			},
			error : function(xhr, stat, e) {
				console.error(xhr);

			}

		});
		return outTrxObj;
	}
})
